MCQ Answer

<p>What will be the output of the following Python code?</p><pre>from math import factorial<br>print(math.factorial(5))</pre><div><br></div>

What will be the output of the following Python code?

from math import factorial
print(math.factorial(5))



निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

from math import factorial
print(math.factorial(5))
Topic : Functions in Python

A. 120

B. Nothing is printed कुछ भी प्रिंट नहीं होगा

C. NameError: name 'math' is not defined एरर मेथड फुक्टोरिअल मैथ मॉडयूल एकसिस्ट नहीं करता

D. Error, the statement should be print factorial(5)) एरर स्टेटमेंट होनी चाहिए print(factorial(5 ))




Correct Answer is :

C. NameError: name 'math' is not defined



Explanation
from math import factorial
print(factorial(5))
gives the result 120 , when we use from keyword to import a particular function then we can not use module name as prefix in function.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz